<form method="post">
    <div class="panel dux-box">
    <div class="table-tools clearfix">
        共找到未被使用的图片 {count($list)} 张。
    </div>
       <div class="table-responsive">
        <table id="table" class="table table-hover ">
            <tbody>
                <tr>
                    <th width="50">序号</th>
                    <th width="*">图片地址</th>
                    <th width="200">操作</th>
                </tr>
                <!-- if{!empty($list)} -->
                <!-- loop{$list as $vo} -->
                <tr>
                  <td><input type="checkbox" name="id[]" value="{$vo}" /></td>
                  <td><a class="js-look" href="javascript:;">{$vo}</a></td>
                  <td>
                       <a class="button bg-red button-small icon-trash-o js-delfile" href="javascript:;" data-val="{$vo}" title="删除"></a>
                  </td>
                </tr>
                <!-- {/loop} -->
                <!-- {/if} -->
            </tbody>
        </table>
        </div>

         <div class="panel-foot table-foot clearfix">
        <div class="float-left">
            <div class="form-inline">
                <div class="form-button">
                    <a class="button bg-blue button-small" id="selectAll" type="button">全选</a>
                    <a class="button bg-blue button-small" id="actionclear" type="submit">执行清理</a>
                </div>

            </div>
            <br>
        </div>
    </div>
    </div>
</form>
<script>
Do.ready('base',function() {
	$('#table').duxTable({
		deleteUrl: "{url('del')}"
	});
});
$(function(){
    $(".js-delfile").click(function(){
        alert($(this).attr("data-val"));
    });
    $("#actionclear").click(function(){
        _count = $("input:checked").length;
        _delnums = 0;
        $("input:checked").each(function(i){
            _val = $(this).val();
            $.get("{url('clear')}",{"val":_val},function(data){
                if(data !== "false" || data !== false){
                    _delnums++;
                    _H = (_delnums/_count)*100;
                    _H = _H.toFixed(2);
                    $("a[data-val='"+data+"']").removeClass("js-delfile bg-red").text(" √ 已经删除 "+_H+"%").addClass("bg-green");
                    _offset = $("a[data-val='"+data+"']").offset();
                    $("html, body").animate({scrollTop: _offset.top-100}, 120);
                }
            });
        });
        alert("全部清理完毕，请返回！");
        location.replace(location.href);
    });
});
</script>